package thread.atomic;

/**
 * @author liweimin
 * @date 2021/4/29 17:05
 * @since
 */
public class AtomicUser {
    int id;
    volatile int age;//使用AtomicIntegerFieldUpdate去更新

    @Override
    public String toString() {
        return "AtomicUser{" +
                "id=" + id +
                ", age=" + age +
                '}';
    }

    public AtomicUser() {
    }

    public AtomicUser(int id, int age) {
        this.id = id;
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
